package com.ln.controller;

import com.ln.entity.AliPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/15 9:46
 */
@RestController
public class HelloController {
    @RequestMapping("/hello")
    public Map<String,Object> hello(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("name","王德发");
        map.put("age",18);
        return map;
    }

    @Autowired
    private AliPay aliPay;
    @RequestMapping("/index")
    public AliPay index(){
        return aliPay;
    }

    @Value("${server.port}")
    private Integer port;

    @Value("${student.name}")
    private String name;

    @RequestMapping("/value")
    public String value(){
        return "服务器的端口号:"+port+";姓名:"+name;
    }
}
